//
//  BaseViewModel.h
//  XBFrameworkProject
//
//  Created by 徐秀滨 on 2018/11/12.
//  Copyright © 2018 徐秀滨. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger,NetworkRequestType) {
    NetworkRequestPost = 1,
    NetworkRequestGet = 2
};

NS_ASSUME_NONNULL_BEGIN

@interface NetworkViewModel : NSObject

//返回参数定义
@property (nonatomic, assign) BOOL isSuccess;
@property (nonatomic, strong) NSArray *dataArray;
@property (nonatomic, strong) NSDictionary *dataItem;
@property (nonatomic, strong) id dataExtend;
@property (nonatomic, copy) NSString *errorCode;
@property (nonatomic, copy) NSString *errorMsg;

//定义请求方法
- (void)networkRequest:(NSString*)url
            parameters:(id)parameters
                  type:(NetworkRequestType)requestType
          successBlock:(void(^)(void))successBlock
          failureBlock:(void(^)(void))failureBlock;

@end

NS_ASSUME_NONNULL_END
